package com.RMP
{
    import flash.display.*;
    import flash.events.*;
    import com.greensock.*;

    public class HomeShell extends Sprite
    {
        var fadeSpeed:Number;
        var textSlideshow:TextSlideshow;
        var myRoot:MovieClip;
        private var theXML:XMLList;

        public function HomeShell(param1:MovieClip, param2:Number, param3:XMLList) : void
        {
            myRoot = param1;
            fadeSpeed = param2;
            theXML = param3;
            startSlideShow();
            myRoot.stage.addEventListener(Event.RESIZE, onResizer, false, 0, true);
            doResize();
            return;
        }

        public function startSlideShow() : void
        {
            textSlideshow = new TextSlideshow(myRoot, theXML, fadeSpeed);
            addChild(textSlideshow);
            doResize();
            return;
        }

        function doResize() : void
        {
            if (textSlideshow != null)
            {
                textSlideshow.y = Math.round(myRoot.headerH + 2 * (myRoot.unitH + myRoot.gutterH));
            }
            return;
        }

        function onResizer(event:Event)
        {
            doResize();
            return;
        }

        public function fadeInShell() : void
        {
            TweenMax.to(this, fadeSpeed, {alpha:1, overwrite:true});
            return;
        }

    }
}
